3.2.23 \(\int x^2 \sqrt {a+a \sin (c+d x)} \, dx\) [123]

Optimal. Leaf size=98 \[ \frac {8 x \sqrt {a+a \sin (c+d x)}}{d^2}+\frac {16 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}}{d^3}-\frac {2 x^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}}{d} \]

[Out]

8*x*(a+a*sin(d*x+c))^(1/2)/d^2+16*cot(1/2*c+1/4*Pi+1/2*d*x)*(a+a*sin(d*x+c))^(1/2)/d^3-2*x^2*cot(1/2*c+1/4*Pi+
1/2*d*x)*(a+a*sin(d*x+c))^(1/2)/d

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 98, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 18, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3400, 3377, 2718} \begin {gather*} \frac {16 \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right ) \sqrt {a \sin (c+d x)+a}}{d^3}+\frac {8 x \sqrt {a \sin (c+d x)+a}}{d^2}-\frac {2 x^2 \cot \left (\frac {c}{2}+\frac {d x}{2}+\frac {\pi }{4}\right ) \sqrt {a \sin (c+d x)+a}}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x^2*Sqrt[a + a*Sin[c + d*x]],x]

[Out]

(8*x*Sqrt[a + a*Sin[c + d*x]])/d^2 + (16*Cot[c/2 + Pi/4 + (d*x)/2]*Sqrt[a + a*Sin[c + d*x]])/d^3 - (2*x^2*Cot[
c/2 + Pi/4 + (d*x)/2]*Sqrt[a + a*Sin[c + d*x]])/d

Rule 2718

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 3377

Int[((c_.) + (d_.)*(x_))^(m_.)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(-(c + d*x)^m)*(Cos[e + f*x]/f), x]
+ Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 3400

Int[((c_.) + (d_.)*(x_))^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[(2*a)^IntPart[n]
*((a + b*Sin[e + f*x])^FracPart[n]/Sin[e/2 + a*(Pi/(4*b)) + f*(x/2)]^(2*FracPart[n])), Int[(c + d*x)^m*Sin[e/2
 + a*(Pi/(4*b)) + f*(x/2)]^(2*n), x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[a^2 - b^2, 0] && IntegerQ[n
 + 1/2] && (GtQ[n, 0] || IGtQ[m, 0])

Rubi steps

\begin {align*} \int x^2 \sqrt {a+a \sin (c+d x)} \, dx &=\left (\csc \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}\right ) \int x^2 \sin \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \, dx\\ &=-\frac {2 x^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}}{d}+\frac {\left (4 \csc \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}\right ) \int x \cos \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \, dx}{d}\\ &=\frac {8 x \sqrt {a+a \sin (c+d x)}}{d^2}-\frac {2 x^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}}{d}-\frac {\left (8 \csc \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}\right ) \int \cos \left (\frac {c}{2}-\frac {\pi }{4}+\frac {d x}{2}\right ) \, dx}{d^2}\\ &=\frac {8 x \sqrt {a+a \sin (c+d x)}}{d^2}+\frac {16 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}}{d^3}-\frac {2 x^2 \cot \left (\frac {c}{2}+\frac {\pi }{4}+\frac {d x}{2}\right ) \sqrt {a+a \sin (c+d x)}}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.12, size = 92, normalized size = 0.94 \begin {gather*} -\frac {2 \left (\left (-8-4 d x+d^2 x^2\right ) \cos \left (\frac {1}{2} (c+d x)\right )-\left (-8+4 d x+d^2 x^2\right ) \sin \left (\frac {1}{2} (c+d x)\right )\right ) \sqrt {a (1+\sin (c+d x))}}{d^3 \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x^2*Sqrt[a + a*Sin[c + d*x]],x]

[Out]

(-2*((-8 - 4*d*x + d^2*x^2)*Cos[(c + d*x)/2] - (-8 + 4*d*x + d^2*x^2)*Sin[(c + d*x)/2])*Sqrt[a*(1 + Sin[c + d*
x])])/(d^3*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2]))

________________________________________________________________________________________

Maple [C] Result contains complex when optimal does not.
time = 0.04, size = 119, normalized size = 1.21

method result size
risch \(-\frac {i \sqrt {2}\, \sqrt {-a \left (-2-2 \sin \left (d x +c \right )\right )}\, \left (-i d^{2} x^{2}+d^{2} x^{2} {\mathrm e}^{i \left (d x +c \right )}+4 i d x \,{\mathrm e}^{i \left (d x +c \right )}-4 d x +8 i-8 \,{\mathrm e}^{i \left (d x +c \right )}\right ) \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{\left ({\mathrm e}^{2 i \left (d x +c \right )}+2 i {\mathrm e}^{i \left (d x +c \right )}-1\right ) d^{3}}\) \(119\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a+a*sin(d*x+c))^(1/2),x,method=_RETURNVERBOSE)

[Out]

-I*2^(1/2)*(-a*(-2-2*sin(d*x+c)))^(1/2)/(exp(2*I*(d*x+c))+2*I*exp(I*(d*x+c))-1)*(-I*d^2*x^2+d^2*x^2*exp(I*(d*x
+c))+4*I*d*x*exp(I*(d*x+c))-4*d*x+8*I-8*exp(I*(d*x+c)))*(exp(I*(d*x+c))+I)/d^3

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+a*sin(d*x+c))^(1/2),x, algorithm="maxima")

[Out]

integrate(sqrt(a*sin(d*x + c) + a)*x^2, x)

________________________________________________________________________________________

Fricas [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+a*sin(d*x+c))^(1/2),x, algorithm="fricas")

[Out]

Exception raised: TypeError >>  Error detected within library code:   integrate: implementation incomplete (ha
s polynomial part)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int x^{2} \sqrt {a \left (\sin {\left (c + d x \right )} + 1\right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(a+a*sin(d*x+c))**(1/2),x)

[Out]

Integral(x**2*sqrt(a*(sin(c + d*x) + 1)), x)

________________________________________________________________________________________

Giac [A]
time = 1.72, size = 93, normalized size = 0.95 \begin {gather*} 2 \, \sqrt {2} \sqrt {a} {\left (\frac {4 \, x \cos \left (\frac {1}{4} \, \pi - \frac {1}{2} \, d x - \frac {1}{2} \, c\right ) \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}{d^{2}} - \frac {{\left (d^{2} x^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right ) - 8 \, \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )\right )} \sin \left (\frac {1}{4} \, \pi - \frac {1}{2} \, d x - \frac {1}{2} \, c\right )}{d^{3}}\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(a+a*sin(d*x+c))^(1/2),x, algorithm="giac")

[Out]

2*sqrt(2)*sqrt(a)*(4*x*cos(1/4*pi - 1/2*d*x - 1/2*c)*sgn(cos(-1/4*pi + 1/2*d*x + 1/2*c))/d^2 - (d^2*x^2*sgn(co
s(-1/4*pi + 1/2*d*x + 1/2*c)) - 8*sgn(cos(-1/4*pi + 1/2*d*x + 1/2*c)))*sin(1/4*pi - 1/2*d*x - 1/2*c)/d^3)

________________________________________________________________________________________

Mupad [B]
time = 0.84, size = 64, normalized size = 0.65 \begin {gather*} \frac {2\,\sqrt {a\,\left (\sin \left (c+d\,x\right )+1\right )}\,\left (8\,\cos \left (c+d\,x\right )+4\,d\,x-d^2\,x^2\,\cos \left (c+d\,x\right )+4\,d\,x\,\sin \left (c+d\,x\right )\right )}{d^3\,\left (\sin \left (c+d\,x\right )+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(a + a*sin(c + d*x))^(1/2),x)

[Out]

(2*(a*(sin(c + d*x) + 1))^(1/2)*(8*cos(c + d*x) + 4*d*x - d^2*x^2*cos(c + d*x) + 4*d*x*sin(c + d*x)))/(d^3*(si
n(c + d*x) + 1))

________________________________________________________________________________________